Hello, and welcome
to this tutorial. Now I want to get one thing right, this is not an extension
to my MDX tutorials, no, its focusing on one aspect of MDX.
This tutorial, is a fairly advanced, and I would like you all to read the first
three! So the requirements for this tutorial are:
Ok, I am using
the pack called QTX (if I am not corrected, i am not sure if this is the proper
name given), and also using Clear Type® on Microsoft® Windows® XP™
Ok, now, first off we need to make our setup dialog:
Now this is my
dialog, try not to copy it exactly, try and play around with designs, as to
getting all the proper sizes, and making it look good is pretty difficult.
Now with the coding, you want to leave all the buttons and text normal, and
apply a ToolBar MDX code to the big list at the bottom, and you can see it,
but there is
a text file (which is the ProgressBar for our Ram/Lag Bar), which will need
to be made into a ProgressBar with MDX
Toolbar: dll $mdx SetControlMDX $dname id Toolbar flat list
wrap nodivider arrows > $bars
ProgressBar: dll $mdx SetControlMDX $dname id ProgressBar smooth
> $ctl
Note: The aliases I am using come from the original MDX tutorial,
be sure to read them! As I will offer no help if you dont have the right Alias'
This is what it should look like now with the MDX:
Ok, now to the code we have to start doing to run a toolbar script. In this
I use text files, not exactly great I know, but I dont know hash tables :P.
So, we need the alias; alias tbar_text { return toolbar.txt }
Mk, simple! Now this is where things start to get a little tricky, because you
have to start making it write to the text file, I use • to seperate the
items.
Example: c:\path\to\icon.ico• •text• •tooltip•
•flag• •command
Pretty simple eh? Now comes to the difficult part, because we need to write
the alias and it becomes a little confusing if you get your ID's mixed up, especially
with the text and tooltip! Ok, so first things first, setting the icon, you
want to just set this and then unset it towards the end. Ok our alias is going
to be called Write.Tbar
Mk.
Alias write.tbar {
if ($did($dname,idoftextlabel).text = -) { write toolbar.txt - }
else { write toolbar.txt %icon.temp $+ $chr(149) $chr(149) $+ $did($dname,idoftooltip).text
$+ $chr(149) $chr(149) $+ $did($dname,idoftext).text $+ $chr(149) $chr(149)
$+ $did($dname,idofflags).text $+ $chr(149) $chr(149) $+ $did($dname,idofcommand).text
}
}
Ok, now I dont want to have to explain this, I am presuming most of you know
dialogs atleast fairly well, but to sum it up quickly, this will write to the
text file in the format I showed above, and setting %icon.temp is easy, when
click a button just make it set %icon.temp $sfile(C:\,select icon), this is
all fairly easy.
Now if I where to fill in my toolbar editor I would do it like so:
And it would look like in the text: C:\mIRC\System\Icons\START_LOGOFF.ICO•
•Logoff pr0nscript• •• •• •//dialog
-m moo moo
Now, if you want a preview in your little dialog, then this is what your gonna
have to do. We'll call this alias Load.Preview
alias load.preview {
var %a = 1, %r = 3
while (%a <=
$lines($tbar_text)) {
var %i = $read($tbar_text,%a)
if (%i == -) { did -a $dname idofpreview - | load.preview }
else {
did -i $dname idofpreview 1 setimage icon small $gettok(%i,1,149)
did -a $dname idofpreview $gettok(%i,7,149) %r $+($gettok(%i,10,149),$chr(9),$gettok(%i,4,149))
inc %r
}
inc %a
}
}
Now, the gettoks are kind of difficult to explain, but I will try my best, 149
= the mIRC Character for •.
We'll re-call my example: c:\path\to\icon.ico• •text• •tooltip•
•flag• •command
$gettok(%i,1,149) | This is the Icon Path, this always comes first |
$gettok(%i,7,149) | This is the tooltip |
$gettok(%i,10,149) | This is the text |
$gettok(%i,4,149) | This is the command |
This gets confusing and you will have to play around yourself. Now, for this
Load.Preview alias, use it to actually show your toolbar, but you may want to
change
the ID's or make a new Alias for your toolbar one (instead of preview inside
editor). Because the ID's will be different unless you keep them the same.
Now the commands is a lil different, its quite easy and pretty much the same:
alias commands
{
var %a = 1, %r = $did($dname,idoftbar).sel
while (%a <= $lines($tbar_text)) {
var %i = $read($tbar_text,%a)
if (%r = %a) { $gettok(%i,bulletpointofcommand,149) }
inc %a
}
}
Ok, well this concludes this tutorial, I hope this helps. Now its time for shout outs!
=============================== |
Shout Outs |
=============================== |
Kfreak - woof woof! Thanks to you I learnt how to do this, so I can pass it on. Thank you! |
#ScriptaZ - bleh, where would I be without you |
mIRCScripts.org - great bunch a people! |
TuX - Commands Alias |
DragonZap - MDX! |
babyorphan - where would I be without you |
And, You! Thank you for reading |